package com.wbao.dianniu.manager;

import java.util.ArrayList;
import java.util.List;


public class ModifyRemarkHelper {
	private static ModifyRemarkHelper instance;
	private static List<IRemarkChanged> mList;
	
	public static ModifyRemarkHelper getInstance() {
		if (null == instance) {
			instance = new ModifyRemarkHelper();
			mList = new ArrayList<IRemarkChanged>();
		}
		return instance;
	}
	
	public static interface IRemarkChanged{
		public void remarkChanged(String remark);
	}
	
	public void addListener(IRemarkChanged listener) {
		mList.add(listener);
	}

	public void removeListener(IRemarkChanged listener) {
		mList.remove(listener);
	}
	
	/**
	 * 通知权限发生改变
	 */
	public void remarkChanged(String remark){
		for (int i = 0; i < mList.size(); i++) {
			mList.get(i).remarkChanged(remark);
		}
	}
}
